//
//  NRWCarChooseBrandVC.m
//  New_Runway
//
//  Created by NewLife on 2018/3/8.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "NRWCarChooseBrandVC.h"
#import "CarBrandModel.h"

@interface NRWCarChooseBrandVC ()

@end

@implementation NRWCarChooseBrandVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)cellDidClickWithIndex:(NSIndexPath *)indexPath {
    
    if (indexPath.section == 0) {
        if (self.chooseBrandCompleted) {
            self.chooseBrandCompleted(nil, nil);
        }
        [self.navigationController popViewControllerAnimated:YES];
        return;
    }
    
    BrandResult *result  = self.dataArray[indexPath.section - 1];
    Brandinfo *info = [Brandinfo mj_objectWithKeyValues:result.brandInfo[indexPath.row]];
    
    if (self.chooseBrandCompleted) {
        self.chooseBrandCompleted([NSString stringWithFormat:@"%zd",info.brandId], info.brandName.copy);
    }
    
    [self.navigationController popViewControllerAnimated:YES];
}


@end
